# Environment for bigdata HA services.
#
# binDir   - The directory containing the installed scripts.
# pidFile  - The pid is written on this file.
#
# Note: You MUST provide the location of the executable scripts and the
# pid file that is written by $binDir/startHAServices.  These SHOULD be
# absolute path names.

BD_USER="<%= node['bigdata'][:user] %>"
BD_GROUP="<%= node['bigdata'][:group] %>"

binDir=<%= node['bigdata'][:home] %>/bin
pidFile=<%= node['bigdata'][:home] %>/var/lock/pid

##
# ServiceStarter JVM options.
#
# The ServiceStarter is launched as a JVM with the following JVM options.
# The other services (including the HAJournalServer) will run inside of
# this JVM. This is where you specify the size of the Java heap and the
# size of the direct memory heap (used for the write cache buffers and
# some related things).
##
export JVM_OPTS="<%= node['bigdata'][:java_options] %>"

##
# The following variables configure the startHAServices script, which 
# passes them through to HAJournal.config.
##

# Name of the bigdata gederation of services. Override for real install.
export FEDNAME=<%= node['bigdata'][:fedname] %>

# This is different for each HA replication cluster in the same federation
# of services.  If you have multiple such replication cluster, then just
# given each such cluster its own name.
export LOGICAL_SERVICE_ID=<%= node['bigdata'][:logical_service_id] %>

# Local directory where the service will store its state.
export FED_DIR=<%= node['bigdata'][:home] %>
export DATA_DIR=<%= node['bigdata'][:data_dir] %>

# Apache River - NO default for "LOCATORS".
export GROUPS="${FEDNAME}"
export LOCATORS="jini://<%= node['bigdata'][:river_locator1] %>/,jini://<%= node['bigdata'][:river_locator2] %>/,jini://<%= node['bigdata'][:river_locator3] %>/"

# Apache ZooKeeper - NO default.
export ZK_SERVERS="<%= node['bigdata'][:zk_server1] %>:<%= node['zookeeper'][:zoocfg][:clientPort] %>,<%= node['bigdata'][:zk_server2] %>:<%= node['zookeeper'][:zoocfg][:clientPort] %>,<%= node['bigdata'][:zk_server3] %>:<%= node['zookeeper'][:zoocfg][:clientPort] %>"


# All of these have defaults. Override as necessary.
#export REPLICATION_FACTOR=3
#export HA_PORT=9090
#export JETTY_PORT=9999
#export JETTY_XML=var/jetty/jetty.xml
#export JETTY_RESOURCE_BASE=var/jetty/html
#export COLLECT_QUEUE_STATISTICS=
#export COLLECT_PLATFORM_STATISTICS=
#export GANGLIA_REPORT=
#export GANGLIA_LISTENER=
#export SYSSTAT_DIR=
